<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>修改银行卡密码</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<div class="container mt-5">
    <h2 class="mb-4">修改银行卡密码</h2>

    <!-- 提示信息 -->
    <div th:if="${error}" class="alert alert-danger" th:text="${error}"></div>
    <div th:if="${message}" class="alert alert-success" th:text="${message}"></div>

    <form th:action="@{/admin/card/changePassword}" method="post">
        <div class="mb-3">
            <label for="cardId" class="form-label">银行卡号</label>
            <input type="text" class="form-control" id="cardId" name="cardId" required>
        </div>
        <div class="mb-3">
            <label for="oldPass" class="form-label">原密码</label>
            <input type="password" class="form-control" id="oldPass" name="oldPass" required>
        </div>
        <div class="mb-3">
            <label for="newPass" class="form-label">新密码</label>
            <input type="password" class="form-control" id="newPass" name="newPass" required>
        </div>
        <button type="submit" class="btn btn-primary">确认修改</button>
        <button type="button" class="btn btn-secondary" onclick="resetForm()">重置</button>
        <a th:href="@{/customer/index}" class="btn btn-secondary ms-2">返回首页</a>
    </form>

    <script>
        function resetForm() {
            document.getElementById("cardId").value = "";
            document.getElementById("newPass").value = "";
            document.getElementById("oldPass").value = "";
        }
    </script>
</div>
</body>